package pl.omega.selenium;

import static org.junit.Assert.assertEquals;

import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import pl.omega.selenium.model.Film;

public class AddFilmNegative extends pl.omega.selenium.pages.TestBase {

  @BeforeMethod
  public void mayBeLogout() {
    if (app.getUserHelper().isLoggedIn()) {
      return;
    }
    app.getUserHelper().loginAs(ADMIN);
  }

  
  @Test
  public void addFilmNegative() {
	  Film film = new Film().setTitle("NewFilm");
	  int countFilmBefore = app.getFilmHelper().getFilmCount();
	  app.getFilmHelper().create(film);
	  int countFilmAfter = app.getFilmHelper().getFilmCount();
	  assertEquals(countFilmBefore, countFilmAfter);
	  
  }
}
